<!DOCTYPE html>

<style>
    #pre { white-space: pre; }
</style>

<p id="non-pre">      <span>Should be indented</span>     </p>
<p id="pre">      <span>Should not be indented</span>     </p>

<script>
onload = function() {
    var nonPre = document.getElementById('non-pre');
    var pre = document.getElementById('pre');
    pre.id = "non-pre";
    nonPre.id = "pre";
};
</script>
